import java.util.Scanner;

public class Main {
    public static void main3(String[] args) {
        Scanner in = new Scanner(System.in);

        while(in.hasNext()) {

            int n = in.nextInt();

            String str1 = in.next();
            String str2 = in.next();

            in.nextLine();
            String[] str = new String[n];
            for (int i = 0; i < n; i++) {
                str[i] = in.nextLine();
            }

            if (str1 == null || str2 == null) {
                System.out.println(-1);
                continue;
            }


            //肯定存在
            int p1 = -1;
            int p2 = -1;
            for (int i = 0; i < n; i++) {
                if (str[i].equals(str1)) {
                    if (p1 == -1) {
                        p1 = i;
                    } else {
                        if (p2 == -1) {
                            p1 = i;
                        } else {
                            if (i - p2 < Math.abs(p2 - p1)) {
                                p1 = i;
                            }
                        }
                    }
                }
                if (str[i].equals(str2)) {
                    if (p2 == -1) {
                        p2 = i;
                    } else {
                        if (p1 == -1) {
                            p2 = i;
                        } else {
                            if (i - p1 < Math.abs(p2 - p1)) {
                                p1 = i;
                            }
                        }
                    }

                }

            }

            if (p1 == -1 || p2 == -1 || (p1 == -1 && p2 == -1)) {
                System.out.println(-1);
            } else {
                System.out.println(Math.abs(p1 - p2));
            }

        }
    }

    public static int fun1(int i,int[] arr){

        int cost = 0;
        int n = arr.length;
        while(i < n){
            cost += arr[i];

            //检测是加两步还是一步
            if(i + 1 == n -1 || i == n -1){
                break;
            }else{
                if(arr[i + 1] >= arr[i + 2]){
                    i += 2;
                }else{
                    i++;
                }
            }
        }
        return cost;
    }
    public static void main2(String[] args) {
        //1.输入
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int n = scanner.nextInt();

            int i = 0;
            int[] arr = new int[n];
            for(;i < n;i++){
                arr[i] = scanner.nextInt();
            }

            int cost = 0;
            //排除长度为1的台阶
            if(n == 1){
                System.out.println(arr[0]);
                continue;
            }

            //2.遍历数组
            int cost1 = fun1(0,arr);
            int cost2 = fun1(1,arr);

            if(cost1 > cost2){
                cost = cost2;
            }else{
                cost = cost1;
            }

            System.out.println(cost);
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextLine()) { // 注意 while 处理多个 case
            float a = in.nextFloat();
            String b = in.next();

            int cost = 0;
            //1.在1kg以内的
            if(a <= 1.0){
                if(b.charAt(0) == 'y'){
                    cost = 20 + 5;
                }
                else{
                    cost = 20;
                }
            }else{

                int n = (int)(a -1) ;
                if(a - n != 0.0f){
                    n = n + 1;
                }
                if(b.charAt(0) == 'y'){
                    cost = 5 + 20 + n ;
                }else{
                    cost = 20 + n;
                }
            }
            System.out.println(cost);

        }
    }
}